-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PGN Parser #3
PGN Parser #3
Conversation
Just saw someone else is also working on this as well |
There is still one test which fails. Will fix later
Still need a way to mock a function in dart.
Also removes streaming parser
Added benchmarks for the parser. After updating the packages use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed only the public facing API aspect for now; there are a lot of changes to do that should be tested with dart doc
comment to eliminate unresolved doc references.
thank you!
lib/src/pgn.dart
Outdated
bool operator ==(Object other) { | ||
return other is Comment && | ||
text == other.text && | ||
// shapes == other.shapes && List == operator doesnt compare each component of list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this code is commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was used in testing to check if two comment objects were equal. But dart doesn't equate the list even if they have the same elements.
I don't think it's necessary.
1. Renamed classes Node-> PgnNode, ChildNode->PgnChildNode, Game->PgnGame 2. Renamed parsePgn to parseMultiGamePgn 3. Added static methods makePgn and parsePgn to PgnGame 4. Moved makeVariant to its enum and renamed it to Variant.fromPgn 5. Move headers function to PgnGame 6. Removed walk function 7. Made some enums and classes private 8. Moved Outcome function to its class
1. Add makePgn benchmark 2. Renmane Comment and Evaluation Classes 3. Move function into classes 4. update tests
Also renamed functions and added comments
/// SAN representation of the move | ||
final String san; | ||
|
||
/// Starting comments of the node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is a starting comment? it's hard to understand without context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand it either but chessops
had it so I implemented that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PGN moves can have a comment before and/or after the move.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
1. Seperate PgnNodeData copyWith into 2 sepearate functions 2. Rename transformStack 3. Change parse function type and make PgnParse private 4. Use stringBuffer in makePgn instead of lists 5. Fix hashCode and == operator for PgnEvaluation
#1